package com.ruoyi.job.task;

import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.job.domain.SignHistory;
import com.ruoyi.job.service.ISignHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("SignTask")
public class SignTask
{
    @Autowired
    private ISignHistoryService signHistoryService;

    public void resetSign(){
        List<SignHistory> list = signHistoryService.selectSignHistoryList(new SignHistory());
        for(SignHistory signHistory:list){
            if(signHistory.getSignTimes()==6l){
                signHistory.setSignTimes(0l);
            }
            if(signHistory.getSignType().equals("0")){
                signHistory.setSignTimes(0l);
            }
            signHistory.setSignType("0");
            signHistory.setCollectionPoint("0");
            signHistoryService.updateSignHistory(signHistory);
        }
    }
}
